﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Web.Models;
using Joz.BLL;
using System.Threading;
using Web.Models.MvcExtension;
using Common;

namespace Web.Controllers
{
    public class HomeController : LoginCheckedController
    {
        public IActionResult Index(int pid = 1)
        {
            int totalCount = 0;
            var result = DDRecords_Bll.Instance.GetModelList(ref totalCount, "", "", "", 15, pid);
            ViewBag.totalCount = totalCount;
            return View(result);
        }

        public IActionResult About()
        {
            ViewData["Message"] = "Your application description page.";
            return View();
        }

        public IActionResult Contact()
        {
            ViewData["Message"] = "Your contact page.";

            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}
